package cloud.ben.smallscalepigfarmmanagementsystem.entity.sow;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Author: Ben
 * @Date: 2022/4/1 11:29
 */
@Data
@ApiModel(description = "母猪基本信息表")
@ToString
//@NoArgsConstructor
@TableName("sow")
public class Sow {

    /**
     *母猪编号
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(required = true,value = "母猪编号")
    private Integer sowNumber;


    /**
     *母猪名
     */
    @ApiModelProperty(required = true,value = "母猪名")
    @NotNull(message = "母猪名为空")
    private String sowName;


    /**
     * 耳号
     */
    @ApiModelProperty(required = true,value = "耳号")
    @NotNull(message = "耳号为空")
    private Integer overBit;



    /**
     * 品种
     */
    @ApiModelProperty(required = true,value = "品种")
    @NotNull(message = "品种为空")
    private String variety;

    /**
     * 出生日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(required = true,value = "出生日期")
    @NotNull(message = "出生日期为空")
    private Date birth;

    /**
     * 胎次
     */
    @ApiModelProperty(required = true,value = "胎次")
    @NotNull(message = "胎次为空")
    private Integer parity;

    /**
     * 父耳号
     */
    @ApiModelProperty(required = true,value = "父耳号")
    @NotNull(message = "父耳号为空")
    private Integer fatherOverBit;

    /**
     *母耳号
     */
    @ApiModelProperty(required = true,value = "母耳号")
    @NotNull(message = "母耳号为空")
    private Integer motherOverBit;

    /**
     * 断奶日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(required = true,value = "断奶日期")
    @NotNull(message = "断奶日期为空")
    private Date weaningDate;

    /**
     * 乳头
     */
    @ApiModelProperty(required = true,value = "乳头")
    @NotNull(message = "乳头为空")
    private Integer papilla;


    public Sow(Integer sowNumber, Integer overBit, String sowName, String variety, Date birth, Integer parity, Integer fatherOverBit, Integer motherOverBit, Date weaningDate, Integer papilla) {
        this.sowNumber = sowNumber;
        this.overBit = overBit;
        this.sowName = sowName;
        this.variety = variety;
        this.birth = birth;
        this.parity = parity;
        this.fatherOverBit = fatherOverBit;
        this.motherOverBit = motherOverBit;
        this.weaningDate = weaningDate;
        this.papilla = papilla;
    }


    public Sow(Integer overBit, String sowName, String variety, Date birth, Integer parity, Integer fatherOverBit, Integer motherOverBit, Date weaningDate, Integer papilla) {
        this.overBit = overBit;
        this.sowName = sowName;
        this.variety = variety;
        this.birth = birth;
        this.parity = parity;
        this.fatherOverBit = fatherOverBit;
        this.motherOverBit = motherOverBit;
        this.weaningDate = weaningDate;
        this.papilla = papilla;
    }


    public Sow() {
    }
}
